//
//  warningCell.m
//  WHB_driver
//
//  Created by 徐国庆 on 15/12/24.
//  Copyright (c) 2015年 turing. All rights reserved.
//

#import "warningCell.h"

@implementation warningCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
        self.bottomView.layer.borderWidth = 0.5;
        [self.contentView addSubview:self.bottomView];
        
        // 160 * 118
        self.warningImageView = [[UIImageView alloc] initWithFrame:CGRectMake((self.frame.size.width - 160) / 2, (self.frame.size.height - 138) / 2, 160, 118)];
        [self.bottomView addSubview:self.warningImageView];
        
        //
        self.warningLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.warningImageView.frame.origin.x, CGRectGetMaxY(self.warningImageView.frame) - 30, 160, 20)];
        self.warningLabel.textAlignment = 1;
        [self.bottomView addSubview:self.warningLabel];
        
        self.infoImageView = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.warningImageView.frame) - 55, self.warningImageView.frame.origin.y + 20, 30, 15)];
        [self.bottomView addSubview:self.infoImageView];
        
        self.infoLabel = [[UILabel alloc] init];
        self.infoLabel.frame = self.infoImageView.frame;
        self.infoLabel.textAlignment = 1;
        self.infoLabel.textColor = [UIColor whiteColor];
        self.infoLabel.layer.masksToBounds = YES;
        self.infoLabel.layer.cornerRadius = 7.5;
        self.infoLabel.font = [UIFont systemFontOfSize:15];
        [self.bottomView addSubview:self.infoLabel];
        self.infoLabel.backgroundColor = [UIColor redColor];
        
    }
    return self;
}

@end
